import Qt 4.7

Rectangle {
    id: container
    width: 200
    height: 200
    color: "#0000ff"

    Rectangle {
        width: 100
        height: 100
        x: mouseArea.mouseX
        y: mouseArea.mouseY
        color: "#ff0000"

    }

    MouseArea {
        id: mouseArea
        width: parent.width
        height: parent.height
        onClicked: console.log("clicked")
    }

}